<%@ page language="java" import="java.util.*,com.beans.*,com.dao.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
	<base href="<%=basePath%>">
		<script type="text/javascript" src="js/jquery-1.4.4.js" ></script>
		<script type="text/javascript">
			$(function(){
					$("#bigCateId").change(function(){
						//alert($("#bigCateId").val());   
						$.ajax({
							url:"AjaxCategoryServlet",
							method:"post",
							data:{cateId:$("#bigCateId").val()},
							dataType:"json",
							cache:false,
							async:true,
							success:function(data){
									$('#smallCateId').empty(); 
								var head="<option value='0'>小分类 </option>"
								var optionStr="";
								for(var i=0;i<data.length;i++){
									optionStr+= "<option value='"+data[i].id+"'>"+data[i].cateName+"</option>";
								}
								
								head+=optionStr;
								 $('#smallCateId').append(head); 
							}
						});
					}
				);
			});
		</script>
			 <link rel="stylesheet" href="${pageContext.request.contextPath }/css/stylesheet.css" type="text/css"></link>
		 <%
		 	//查询大分类信息集合 用于初始本页面中上面的第一个下拉框
		 		   		 List<CateInfo> categoryList =  CateDao.getCategotyList(0); //参数0表示查询一级分类
		 		   		 request.setAttribute("categoryList",categoryList);
		 %>
  		 
  		<table id="table1">
	   <tr style="padding-top: 10px">
	    <td height="50" colspan="4">
	    <div align="center">
		     <form name="form1" method="post" action="${pageContext.request.contextPath }/GoodsServlet?flag=search">
		     ${sessionScope.user.memberNo}
			    <a href="UserServlet?flag=logout" class="sethome" target="_parent">
			     <img src="images/tuichu.bmp" align="middle" border="0">
			    </a> 
		        <a href="${pageContext.request.contextPath }/user/userEdit.jsp?id=${sessionScope.user.id}" class="sethome" target="_parent">
		          <img src="images/yonghuxinxi.bmp" align="middle" border="0">
		         </a>
		          <a href="javascript://" 
		            onClick="this.style.behavior='url(#default#homepage)';this.setHomePage('http://localhost:8080/NEUFriendsEshop/index.jsp')" 
		            target="_parent" style="font-size:12px">
		             NEUFriendsEshop设为主页
		        </a> 

		     	 <img src="images/icon_login.gif" align="middle">
		         <input type="text" id="goodsName" name="goodsName" value="商品关键字" onClick="this.value=''"/>
				   <select name="bigCateId" id="bigCateId">
			            <option value="0">大分类 </option>
			            <c:forEach var="category" items="${categoryList}">
			            	<option value='${category.id }'>${category.cateName}</option>
			            </c:forEach>
			        </select>
			        <select id="smallCateId" name="smallCateId">
			            <option VALUE="0">小分类 </option>
			        </select>
			     <input type="image" src="images/icon_search.gif" style="margin-top: 3px"  onclick="javascript:document.form1.submit();return false"/>
		 
	         </form> 
	     </div>
	     </td>
	  </tr>

    <tr>
    <td colspan="4">
        <img src="images/title.jpg" width="790px" hspace="35">
        <div style="margin-top: 3px"></div>
        <table >
          <tr align="center">
            <td valign="top" align="right" width="32"><img src="images/icon02.gif"></td>
            <td width="154" align="center" class="header_menu"><a href="index.jsp"><span class="whiteTitle">商城首页</span></a> </td>
            <td background="images/Bule_06.jpg" align="left" width="2"></td>
            <td width="206" align="center" class="header_menu"><a href="${pageContext.request.contextPath }/shopping/shopCartList.jsp"><span class="whiteTitle">购物车管理</span></a> </td>
            <td background="images/Bule_06.jpg" width="2"></td>
            <td width="167" align="center" class="header_menu"><a href="${pageContext.request.contextPath }/ShopCartServlet?flag=zhifu"><span class="whiteTitle">支付管理</span></a> </td>
            <td background="images/Bule_06.jpg" width="2"></td>
            <td width="172" align="center" class="header_menu"><a href="${pageContext.request.contextPath }/order/orderSearch.jsp"><span class="whiteTitle">订单管理</span></a></td>
            <td background="images/Bule_06.jpg" width="1"></td>
            <td valign=top align="left" width=40><img src="images/icon07.gif"></td>
          </tr>
      </table>
     </td>
  </tr>
  </table>

